About using criteria
Criteria allow you to specify one or more conditions to limit which
records are included in the result set of a query. For example, consider
the following table of data:
| Orders |
| Category |
Order_Date |
Quantity |
Unit_Price |
Phone |
Region |
| Dairy |
06/05/02 |
25 |
25.00 |
(111) 555-3303 |
USA |
| Dairy |
06/07/02 |
35 |
25.00 |
(222) 555-3237 |
Norway |
| Fruit |
06/09/02 |
47 |
15.00 |
(555) 555-5522 |
France |
| Fruit |
06/11/02 |
13 |
15.00 |
(444) 555-3465 |
Italy |
| Nuts |
06/20/02 |
89 |
8.00 |
(222) 555-1243 |
Norway |
| Fruit |
06/23/02 |
43 |
15.00 |
(111) 555-8909 |
USA |
| Dairy |
06/25/02 |
30 |
25.00 |
(333) 555-1298 |
Germany |
You can specify criteria
to retrieve records as follows:
- You can find all the records with values that contain characters you specify.
For example, you can find all the records for suppliers whose phone numbers begin
with the area code (111). To use this criteria, you would click Orders:Phone
in the Field box and then type Like '(111)%' in the Criteria
box. You must place the text you want to find within single quotation marks.
- You can find records that don't match a value. For example, you can find all the
records for suppliers who are located outside of the United States. To use this criteria,
you would click Orders:Region in the Field box and then type <>
'USA' in the Criteria box.
- You can find records that contain missing or incomplete values. For example, you
can find all the records for orders that are missing an order date. To use this criteria,
you would click Reports_To in the Field box and then type Is Null in
the Criteria box.
- You can find records that contain any of several values. For example, you can find
all the records for suppliers located in Germany, France, or the USA. To use this
criteria, you would click Orders:Region in the Field box and then type
IN ('Germany', 'France', 'USA') in the Criteria box.
Note When you select a criteria
field, make sure that you use the field from the correct table. For example, if you want
to find all the suppliers for a particular region, select the Region field from the Supplier
table rather than from the Customer table.
Related topics
Retrieve records that match a specific value
Specify what records to retrieve by using criteria